<template>
  <div class="header-nav">
    <div
      class="header-nav-item"
      v-for="(item, index) in catList"
      :key="index"
      :class="[index == 0 ? 'active' : '']"
    >
      <span class="item-text">{{ item.name }}</span>
      <span class="item-active-line"></span>
    </div>
  </div>
</template>

<script>
export default {
  name: "",
  props: {
    propsData: {
      type: Object,
      default: {},
    },
    catList:{
      type: Array,
      default: () => {
        return []
      },
    }
  },
  mixins: [],
  components: {},
  data() {
    return {
      dataList: [
        {
          text: "推荐分类",
        },
        {
          text: "精选超市",
        },
        {
          text: "家电",
        },
      ],
      activeTab: 0,
    };
  },
  mounted() {},
  watch: {},
  computed: {},
  methods: {},
};
</script>

<style lang="scss" scoped>
.header-nav {
  width: 100%;
  height: 45px;
  background: #ffffff;
  display: flex;
  align-items: center;
  padding: 0 18px;
  overflow-x: scroll;
  overflow-y: hidden;
  .header-nav-item {
    white-space: nowrap;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-right: 4.8%;
    .item-text {
      font-size: 14px;
      font-family: PingFang SC;
      font-weight: 400;
      color: #262626;
    }
    .item-active-line {
      width: 25px;
      height: 3px;
      margin-top: 2px;
      display: inline-block;
    }
  }
  .active {
    .item-text {
      font-weight: 600;
      color: #262626;
    }
    .item-active-line {
      background: #f0250e;
    }
  }
  .header-nav-item:last-child{
    margin-right: 0;
  }
}
.header-nav::-webkit-scrollbar {
  width: 0;
  height: 0;
}
</style>
